$OpenBSD: patch-src_configure_ac,v 1.2 2017/04/29 21:04:29 sthen Exp $
--- src/configure.ac.orig	Fri Apr 28 14:45:46 2017
+++ src/configure.ac	Fri Apr 28 22:58:13 2017
@@ -568,10 +568,10 @@ if test "$enable_luainterp" = "yes" -o "$enable_luaint
 	AC_MSG_RESULT(yes)
       else
 	AC_MSG_RESULT(no)
-	AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
-	if test -f "$vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h"; then
+	AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua-$vi_cv_version_lua)
+	if test -f "$vi_cv_path_lua_pfx/include/lua-$vi_cv_version_lua/lua.h"; then
 	  AC_MSG_RESULT(yes)
-	  LUA_INC=/lua$vi_cv_version_lua
+	  LUA_INC=/lua-$vi_cv_version_lua
 	else
 	  AC_MSG_RESULT(no)
 	  vi_cv_path_lua_pfx=
@@ -596,9 +596,9 @@ if test "$enable_luainterp" = "yes" -o "$enable_luaint
     else
       if test "X$LUA_INC" != "X"; then
 	dnl Test alternate location using version
-	LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua"
+	LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua -lm"
       else
-	LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua"
+	LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua -lm"
       fi
     fi
     if test "$enable_luainterp" = "dynamic"; then
